

****************Replication Dofile for "Aiding War or Peace? The insiders’ view on aid to post-conflict transitions" ************

******Open Dataset ****

use "Aiding_War_Replication_Dataset.dta", clear



**********Figure 1****

***Input to create Figure 1:

**cross-tab of treatment and response variable
tab treatment hum_aid, mis
tab treatment dev_aid, mis
tab treatment tran_aid, mis
tab treatment bud_aid, mis

*This output was copied to a new excel file ("Figure1_input.xlsx"), which was then used as input for Figure 1

**Creating Figure 1

*Each sub-figure was manually adapted after creation using the Stata graph editor to change colors and font size

*sub-figure Humanitarian Aid
import excel "Figure1_input.xlsx", sheet("hum_aid") firstrow clear

graph bar   Decrease No_Change Increase , over (Help_new) percent stack scheme(s1manual) title("Humanitarian Aid") ytitle("Percentage of endorsements")  legend( label(3 "Aid increase") label(1 "Aid decrease") label(2 "No change") )

graph save "hum_aid_final_new_finalversion.gph", replace 


*sub-figure Development Aid
import excel "Figure1_input.xlsx", sheet("dev_aid") firstrow clear

graph bar   Decrease No_Change Increase, over (Help_new) percent stack scheme(s1manual) title("Development Aid") ytitle("Percentage of endorsements")  legend( label(3 "Aid increase") label(1 "Aid decrease") label(2 "No change") )

graph save "dev_aid_final_new_finalversion.gph", replace


*sub-figure Transitional Aid
import excel "Figure1_input.xlsx", sheet("tran_aid") firstrow clear

graph bar   Decrease No_Change Increase, over (Help_new) percent stack scheme(s1manual) title("Transitional Aid") ytitle("Percentage of endorsements")  legend( label(3 "Aid increase") label(1 "Aid decrease") label(2 "No change") )

graph save "tran_aid_final_new_finalversion.gph", replace


*sub-figure Budgetary Aid
import excel "Figure1_input.xlsx", sheet("bud_aid") firstrow clear

graph bar  Decrease No_Change Increase , over (Help_new) percent stack scheme(s1manual) title("Budgetary Aid") ytitle("Percentage of endorsements") legend( label(3 "Aid increase") label(1 "Aid decrease") label(2 "No change") )

graph save "bud_aid_final_new_finalversion.gph", replace


graph combine "hum_aid_final_new_finalversion.gph"  "tran_aid_final_new_finalversion.gph" "dev_aid_final_new_finalversion.gph" "bud_aid_final_new_finalversion.gph"

graph export "Figure_1_finalversion.pdf", replace



**************Figure 2*********************

**Open original dataset again

use "Aiding_War_Replication_Dataset.dta", clear

***Four Multinomial Models are the baseline of Figure 2, one for each dependent variable (humanitarian, development, budgetary and transitional aid)
***Based on each of the models, we calculated predicte probabilities for each scenario (12 in total per model)
***These predicted probabilities were saved in a new excel file ("multinomial_results.xlsx") which was then split into four separate .txt files (multinomial_results_r_bud_order, multinomial_results_r_dev_order, multinomial_results_r_hum_order, multinomial_results_r_trans_order)
***We used the Software R to create Figure 2 from these four input .txt files using the R-Code-File "Figure_2_Predicted_Probabilities"

***The corresponding Regression Table, Table 5 in Appendix B, displays the multinomail results as relative risk ratios and was created using the following code


**Multinomial logit with relative risk ratio
mlogit hum_aid strong_vio mild_vio mild_peace, rrr baseoutcome(2)

mlogit tran_aid strong_vio mild_vio mild_peace, rrr baseoutcome(2)

mlogit dev_aid strong_vio mild_vio mild_peace, rrr baseoutcome(2)

mlogit bud_aid strong_vio mild_vio mild_peace, rrr baseoutcome(2)


********Corresponding Predicted Probabilities
*humanitarian aid
set more off
mlogit hum_aid strong_vio mild_vio mild_peace, baseoutcome(2)

margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(2))
margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(3)) 

*predicted probabilities for mild violence all outcomes 
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(2))
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(3))  

*predicted probabilities for mild peace all outcomes 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(2)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(3)) 

*predicted probabilities for strong peace all outcomes 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(2)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(3)) 

*transitional aid
mlogit tran_aid strong_vio mild_vio mild_peace, baseoutcome(2)

margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(2))
margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(3)) 

*predicted probabilities for mild violence all outcomes 
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(2))
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(3))  

*predicted probabilities for mild peace all outcomes 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(2)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(3)) 

*predicted probabilities for strong peace all outcomes 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(2)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(3)) 


*development aid
mlogit dev_aid strong_vio mild_vio mild_peace, baseoutcome(2)

margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(2))
margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(3)) 

*predicted probabilities for mild violence all outcomes 
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(2))
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(3))  

*predicted probabilities for mild peace all outcomes 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(2)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(3)) 

*predicted probabilities for strong peace all outcomes 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(2)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(3)) 


*budgetary aid
mlogit bud_aid strong_vio mild_vio mild_peace, baseoutcome(2)

margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(2))
margins, at(strong_vio=1 mild_vio=0 mild_peace=0) predict(outcome(3)) 

*predicted probabilities for mild violence all outcomes 
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(2))
margins, at(strong_vio=0 mild_vio=1 mild_peace=0) predict(outcome(3))  

*predicted probabilities for mild peace all outcomes 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(2)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=1) predict(outcome(3)) 

*predicted probabilities for strong peace all outcomes 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(1)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(2)) 
margins, at(strong_vio=0 mild_vio=0 mild_peace=0) predict(outcome(3)) 



**********Appendix: Table 6****

****cross-tab of treatment and response variable

***Implementing agencies:

**Development aid
*Treatment: strong violence
tab impl_dev if treatment==1
*Treatment: mild violence
tab impl_dev if treatment==2
*Treatment: mild peace
tab impl_dev if treatment==3
*Treatment: strong peace
tab impl_dev if treatment==4


**Humanitarian aid
*Treatment: strong violence
tab impl_hum if treatment==1
*Treatment: mild violence
tab impl_hum if treatment==2
*Treatment: mild peace
tab impl_hum if treatment==3
*Treatment: strong peace
tab impl_hum if treatment==4


**Budgetary aid
*Treatment: strong violence
tab impl_bud if treatment==1
*Treatment: mild violence
tab impl_bud if treatment==2
*Treatment: mild peace
tab impl_bud if treatment==3
*Treatment: strong peace
tab impl_bud if treatment==4


**Transitional aid
*Treatment: strong violence
tab impl_tran if treatment==1
*Treatment: mild violence
tab impl_tran if treatment==2
*Treatment: mild peace
tab impl_tran if treatment==3
*Treatment: strong peace
tab impl_tran if treatment==4



***Donors:

**Development aid
*Treatment: strong violence
tab donor_dev if treatment==1
*Treatment: mild violence
tab donor_dev if treatment==2
*Treatment: mild peace
tab donor_dev if treatment==3
*Treatment: strong peace
tab donor_dev if treatment==4


**Humanitarian aid
*Treatment: strong violence
tab donor_hum if treatment==1
*Treatment: mild violence
tab donor_hum if treatment==2
*Treatment: mild peace
tab donor_hum if treatment==3
*Treatment: strong peace
tab donor_hum if treatment==4


**Budgetary aid
*Treatment: strong violence
tab donor_bud if treatment==1
*Treatment: mild violence
tab donor_bud if treatment==2
*Treatment: mild peace
tab donor_bud if treatment==3
*Treatment: strong peace
tab donor_bud if treatment==4


**Transitional aid
*Treatment: strong violence
tab donor_tran if treatment==1
*Treatment: mild violence
tab donor_tran if treatment==2
*Treatment: mild peace
tab donor_tran if treatment==3
*Treatment: strong peace
tab donor_tran if treatment==4




****************Appendix Figure 6
***ttest for both groups combined

** The basis of Figure 6 are the following 9 t tests 
** We include the reported difference as well as the 95% Confidence Intervals in Figure 6
** since Stata display diff = mean(0) - mean(1) but we want diff = mean(1) - mean(0) we switch the sign on the difference in our display in Figure 6

*humanitarian aid
ttest hum_aid, by(treat_str_vio)
ttest hum_aid, by(treat_mild_vio)
ttest hum_aid, by(treat_mild_peace)

*transitional aid
ttest tran_aid, by(treat_str_vio)
ttest tran_aid, by(treat_mild_vio)
ttest tran_aid, by(treat_mild_peace)

*development aid
ttest dev_aid, by(treat_str_vio)
ttest dev_aid, by(treat_mild_vio)
ttest dev_aid, by(treat_mild_peace)

*budgetary aid
ttest bud_aid, by(treat_str_vio)
ttest bud_aid, by(treat_mild_vio)
ttest bud_aid, by(treat_mild_peace)

***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_r")
***Figure 6 is then created using R File "Figures_Appendix" lines 21-98



****************Appendix Figure 7
***ttest for both groups combined

** The basis of Figure 7 are the following 18 t tests 
** We include the reported difference as well as the 95% Confidence Intervals in Figure 7
** since Stata display diff = mean(0) - mean(1) but we want diff = mean(1) - mean(0) we switch the sign on the difference in our display in Figure 7


*treatment conditional on people knowing the scenario or not, 
*baseline those with strong peace and also knowing the scenario or not depending on treatment group


***********Scenario known - left panel in Figure 7

*strong violence and scenario known
capture drop group
gen group=1 if strong_vio==1 & scenario_imp==1
replace group=1 if strong_vio==1 & scenario_don==1
replace group=0 if strong_peace==1 & scenario_imp==1
replace group=0 if strong_peace==1 & scenario_don==1
tab group, mis

ttest hum_aid, by(group)
ttest tran_aid, by(group)
ttest dev_aid, by(group)
ttest bud_aid, by(group)


*mild violence and scenario known
capture drop group
gen group=1 if mild_vio==1 & scenario_imp==1
replace group=1 if mild_vio==1 & scenario_don==1
replace group=0 if strong_peace==1 & scenario_imp==1
replace group=0 if strong_peace==1 & scenario_don==1
tab group, mis

ttest hum_aid, by(group)
ttest tran_aid, by(group)
ttest dev_aid, by(group)
ttest bud_aid, by(group)



*mild peace and scenario known
capture drop group
gen group=1 if mild_peace==1 & scenario_imp==1
replace group=1 if mild_peace==1 & scenario_don==1
replace group=0 if strong_peace==1 & scenario_imp==1
replace group=0 if strong_peace==1 & scenario_don==1
tab group, mis

ttest hum_aid, by(group)
ttest tran_aid, by(group)
ttest dev_aid, by(group)
ttest bud_aid, by(group)


***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_r_comb_kown")
***Left Panel of Figure 7 is then created using R File "Figures_Appendix" lines 101-180


***********Scenario unknown - right panel in Figure 7

*strong violence and scenario unknown
capture drop group
gen group=1 if strong_vio==1 & scenario_imp==0
replace group=1 if strong_vio==1 & scenario_don==0
replace group=0 if strong_peace==1 & scenario_imp==0
replace group=0 if strong_peace==1 & scenario_don==0
tab group, mis

ttest hum_aid, by(group)
ttest tran_aid, by(group)
ttest dev_aid, by(group)
ttest bud_aid, by(group)


*mild violence and scenario known
capture drop group
gen group=1 if mild_vio==1 & scenario_imp==0
replace group=1 if mild_vio==1 & scenario_don==0
replace group=0 if strong_peace==1 & scenario_imp==0
replace group=0 if strong_peace==1 & scenario_don==0
tab group, mis

ttest hum_aid, by(group)
ttest tran_aid, by(group)
ttest dev_aid, by(group)
ttest bud_aid, by(group)


*mild peace and scenario known
capture drop group
gen group=1 if mild_peace==1 & scenario_imp==0
replace group=1 if mild_peace==1 & scenario_don==0
replace group=0 if strong_peace==1 & scenario_imp==0
replace group=0 if strong_peace==1 & scenario_don==0
tab group, mis

ttest hum_aid, by(group)
ttest tran_aid, by(group)
ttest dev_aid, by(group)
ttest bud_aid, by(group)


***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_r_comb_unkown")
***Right Panel of Figure 7 is then created using R File "Figures_Appendix" lines 185-262



****************Appendix Figure 8
***ttest differentiated by donors versus implementing agencies

** The basis of Figure 8 are the following 18 t tests 
** We include the reported difference as well as the 95% Confidence Intervals in Figure 8
** since Stata display diff = mean(0) - mean(1) but we want diff = mean(1) - mean(0) we switch the sign on the difference in our display in Figure 8

********Donors - Left panel in Figure 8

*humanitarian aid
ttest donor_hum, by(treat_str_vio)
ttest donor_hum, by(treat_mild_vio)
ttest donor_hum, by(treat_mild_peace)

*transitional aid
ttest donor_tran, by(treat_str_vio)
ttest donor_tran, by(treat_mild_vio)
ttest donor_tran, by(treat_mild_peace)

*development aid
ttest donor_dev, by(treat_str_vio)
ttest donor_dev, by(treat_mild_vio)
ttest donor_dev, by(treat_mild_peace)

*budgetary aid
ttest donor_bud, by(treat_str_vio)
ttest donor_bud, by(treat_mild_vio)
ttest donor_bud, by(treat_mild_peace)


***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_R_donors")
***Left Panel of Figure 8 is then created using R File "Figures_Appendix" lines 268-344




********Implementing Agencies - Right panel in Figure 8
*humanitarian aid
ttest impl_hum, by(treat_str_vio)
ttest impl_hum, by(treat_mild_vio)
ttest impl_hum, by(treat_mild_peace)

*transitional aid
ttest impl_tran, by(treat_str_vio)
ttest impl_tran, by(treat_mild_vio)
ttest impl_tran, by(treat_mild_peace)

*development aid
ttest impl_dev, by(treat_str_vio)
ttest impl_dev, by(treat_mild_vio)
ttest impl_dev, by(treat_mild_peace)

*budgetary aid
ttest impl_bud, by(treat_str_vio)
ttest impl_bud, by(treat_mild_vio)
ttest impl_bud, by(treat_mild_peace)


***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_R_impl")
***Left Panel of Figure 8 is then created using R File "Figures_Appendix" lines 350-427



****************Appendix Figure 9
***ttest differentiated by implementing agencies knowing or not knowing the scenario

** The basis of Figure 9 are the following 18 t tests 
** We include the reported difference as well as the 95% Confidence Intervals in Figure 9
** since Stata display diff = mean(0) - mean(1) but we want diff = mean(1) - mean(0) we switch the sign on the difference in our display in Figure 8


********Implementing Agencies and knowing the scenario - Left panel in Figure 9


*treatment conditional on people knowing the scenario or not, 
*baseline those with strong peace and also knowing or not

*strong violence and scenario known
capture drop group
gen group=1 if strong_vio==1 & scenario_imp==1
replace group=0 if strong_peace==1 & scenario_imp==1

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)

*mild violence and scenario known
capture drop group
gen group=1 if mild_vio==1 & scenario_imp==1
replace group=0 if strong_peace==1 & scenario_imp==1

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)


*mild peace and scenario known
capture drop group
gen group=1 if mild_peace==1 & scenario_imp==1
replace group=0 if strong_peace==1 & scenario_imp==1

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)


***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_r_scenario_known_impl")
***Left Panel of Figure 9 is then created using R File "Figures_Appendix" lines 433-509



********Implementing Agencies and not knowing the scenario - Right panel in Figure 9


*treatment conditional on people knowing the scenario or not, 
*baseline those with strong peace and also knowing or not


*strong violence and scenario unknown
capture drop group
gen group=1 if strong_vio==1 & scenario_imp==0
replace group=0 if strong_peace==1 & scenario_imp==0

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)

*mild violence and scenario unknown
capture drop group
gen group=1 if mild_vio==1 & scenario_imp==0
replace group=0 if strong_peace==1 & scenario_imp==0

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)

*mild peace and scenario unknown
capture drop group
gen group=1 if mild_peace==1 & scenario_imp==0
replace group=0 if strong_peace==1 & scenario_imp==0

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)



***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_r_scenario_unknown_impl")
***Left Panel of Figure 9 is then created using R File "Figures_Appendix" lines 515-591




****************Appendix Figure 10
***ttest differentiated by donors knowing and not knowing the scenario

** The basis of Figure 10 are the following 18 t tests 
** We include the reported difference as well as the 95% Confidence Intervals in Figure 10
** since Stata display diff = mean(0) - mean(1) but we want diff = mean(1) - mean(0) we switch the sign on the difference in our display in Figure 8


********Donors and knowing the scenario - Left panel in Figure 10

*treatment conditional on people knowing the scenario or not, 
*baseline those with strong peace and also knowing or not

*strong violence and scenario known
capture drop group
gen group=1 if strong_vio==1 & scenario_don==1
replace group=0 if strong_peace==1 & scenario_don==1

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)


*mild violence and scenario known
capture drop group
gen group=1 if mild_vio==1 & scenario_don==1
replace group=0 if strong_peace==1 & scenario_don==1

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)


*mild peace and scenario known
capture drop group
gen group=1 if mild_peace==1 & scenario_don==1
replace group=0 if strong_peace==1 & scenario_don==1

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)

***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_r_yes_scenario_donors")
***Left Panel of Figure 10 is then created using R File "Figures_Appendix" lines 598-674



********Donors and not knowing the scenario - Right panel in Figure 10


*treatment conditional on people knowing the scenario or not, 
*baseline those with strong peace and also knowing or not


*strong violence and scenario unknown
capture drop group
gen group=1 if strong_vio==1 & scenario_don==0
replace group=0 if strong_peace==1 & scenario_don==0

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)

*mild violence and scenario unknown
capture drop group
gen group=1 if mild_vio==1 & scenario_don==0
replace group=0 if strong_peace==1 & scenario_don==0

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)

*mild peace and scenario unknown
capture drop group
gen group=1 if mild_peace==1 & scenario_don==0
replace group=0 if strong_peace==1 & scenario_don==0

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)


***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_r_no_scenario_donors")
***Right Panel of Figure 10 is then created using R File "Figures_Appendix" lines 681-757




*****Appendix Table 7
**multinominal logit analysis - Implementing agencies only
mlogit impl_dev strong_vio mild_vio mild_peace, baseoutcome(2)
mlogit impl_bud strong_vio mild_vio mild_peace, baseoutcome(2)
mlogit impl_hum strong_vio mild_vio mild_peace, baseoutcome(2)
mlogit impl_tran strong_vio mild_vio mild_peace, baseoutcome(2)

*****Appendix Table 8
**multinominal logit analysis - Donors only
mlogit donor_dev strong_vio mild_vio mild_peace, baseoutcome(2)
mlogit donor_bud strong_vio mild_vio mild_peace, baseoutcome(2)
mlogit donor_hum strong_vio mild_vio mild_peace, baseoutcome(2) 
mlogit donor_tran strong_vio mild_vio mild_peace, baseoutcome(2)





****************Appendix Figure 11
***ttest differentiated by implementing agencies who received treatment with and without priority status

** The basis of Figure 11 are the following 18 t tests 
** We include the reported difference as well as the 95% Confidence Intervals in Figure 11
** since Stata display diff = mean(0) - mean(1) but we want diff = mean(1) - mean(0) we switch the sign on the difference in our display in Figure 11


***************Implementers****************
*treatment conditional on priority country, 
*baseline those with strong peace and equivalent priority treatment


*strong violence and priority
capture drop group
gen group=1 if prio_strong_vio==1 
replace group=0 if prio_strong_peace==1 

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)

*mild violence and priority
capture drop group
gen group=1 if prio_mild_vio==1 
replace group=0 if prio_strong_peace==1

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)


*mild peace and priority
capture drop group
gen group=1 if prio_mild_peace==1 
replace group=0 if prio_strong_peace==1

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)

***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_r_priority_impl")
***Left Panel of Figure 11 is then created using R File "Figures_Appendix" lines 762-840



*strong violence and no priority
capture drop group
gen group=1 if no_prio_strong_vio==1 
replace group=0 if no_prio_strong_peace==1 

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)


*mild violence and no priority
capture drop group
gen group=1 if no_prio_mild_vio==1 
replace group=0 if no_prio_strong_peace==1 

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)


*mild peace and no priority
capture drop group
gen group=1 if no_prio_mild_peace==1 
replace group=0 if no_prio_strong_peace==1 

ttest impl_hum, by(group)
ttest impl_tran, by(group)
ttest impl_dev, by(group)
ttest impl_bud, by(group)


***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_R_no_priority_impl")
***Right Panel of Figure 11 is then created using R File "Figures_Appendix" lines 849-925



****************Appendix Figure 12
***ttest differentiated by donors who received treatment with and without priority status

** The basis of Figure 12 are the following 18 t tests 
** We include the reported difference as well as the 95% Confidence Intervals in Figure 12
** since Stata display diff = mean(0) - mean(1) but we want diff = mean(1) - mean(0) we switch the sign on the difference in our display in Figure 12


***************Donors****************
*treatment conditional on priority country, 
*baseline those with strong peace and equivalent priority treatment


*strong violence and priority
capture drop group
gen group=1 if prio_strong_vio==1 
replace group=0 if prio_strong_peace==1 

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)


*mild violence and priority
capture drop group
gen group=1 if prio_mild_vio==1 
replace group=0 if prio_strong_peace==1

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)


*mild peace and priority
capture drop group
gen group=1 if prio_mild_peace==1 
replace group=0 if prio_strong_peace==1

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)


***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_r_priority_donors")
***Left Panel of Figure 12 is then created using R File "Figures_Appendix" lines 932-1008


*strong violence and no priority
capture drop group
gen group=1 if no_prio_strong_vio==1 
replace group=0 if no_prio_strong_peace==1 

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)


*mild violence and no priority
capture drop group
gen group=1 if no_prio_mild_vio==1 
replace group=0 if no_prio_strong_peace==1 

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)


*mild peace and no priority
capture drop group
gen group=1 if no_prio_mild_peace==1 
replace group=0 if no_prio_strong_peace==1 

ttest donor_hum, by(group)
ttest donor_tran, by(group)
ttest donor_dev, by(group)
ttest donor_bud, by(group)


***Results of the t-tests (reported difference including standard errors are saved to txt file "ttest_figure_r_no_priority_donors")
***Right Panel of Figure 12 is then created using R File "Figures_Appendix" lines 1015-1091




*****Appendix Table 9 - Seemingly unrelated probit regression

**Implementing agencies
cmp (impl_hum=strong_vio mild_vio mild_peace) (impl_tran=strong_vio mild_vio mild_peace) (impl_bud=strong_vio mild_vio mild_peace) (impl_dev=strong_vio mild_vio mild_peace), ind($cmp_oprobit $cmp_oprobit $cmp_oprobit $cmp_oprobit) nolr tech(dfp) qui

**Donors
cmp (donor_hum=strong_vio mild_vio mild_peace) (donor_tran=strong_vio mild_vio mild_peace) (donor_bud=strong_vio mild_vio mild_peace) (donor_dev=strong_vio mild_vio mild_peace), ind($cmp_oprobit $cmp_oprobit $cmp_oprobit $cmp_oprobit) nolr tech(dfp) qui



*****Appendix Table 10 - Multinomial Regression including covariates

mlogit hum_aid strong_vio mild_vio mild_peace age_cat2-age_cat5 male international, rrr baseoutcome(2)
mlogit tran_aid strong_vio mild_vio mild_peace age_cat2-age_cat5 male international, rrr baseoutcome(2)
mlogit dev_aid strong_vio mild_vio mild_peace age_cat2-age_cat5 male international, rrr baseoutcome(2)
mlogit bud_aid strong_vio mild_vio mild_peace age_cat2-age_cat5 male international, rrr baseoutcome(2)



*****Appendix Table 11 - Ranksum test 

*strong violence
capture drop group
gen group=1 if strong_vio==1 
replace group=0 if strong_peace==1 

ranksum hum_aid, by(group)
ranksum tran_aid, by(group)
ranksum dev_aid, by(group)
ranksum bud_aid, by(group)

*mild violence
capture drop group
gen group=1 if mild_vio==1 
replace group=0 if strong_peace==1 

ranksum hum_aid, by(group)
ranksum tran_aid, by(group)
ranksum dev_aid, by(group)
ranksum bud_aid, by(group)


*mild peace
capture drop group
gen group=1 if mild_peace==1 
replace group=0 if strong_peace==1 

ranksum hum_aid, by(group)
ranksum tran_aid, by(group)
ranksum dev_aid, by(group)
ranksum bud_aid, by(group)



*****Appendix Figure 13 - Bonferroni Correction
** The basis of Figure 13 are the following 9 difference in mean tests with Bonferroni correction 
** We include the reported difference as well as the 95% Confidence Intervals in Figure 13
pwmean hum_aid, over(treatment_bonf)  mcompare(bonferroni)
pwmean tran_aid, over(treatment_bonf)  mcompare(bonferroni)
pwmean dev_aid, over(treatment_bonf)  mcompare(bonferroni)
pwmean bud_aid, over(treatment_bonf)  mcompare(bonferroni)



***Results of the mean tests (reported difference including standard errors are saved to txt file "ttest_aid_allocation_bonferroni")
***Figure 13 is then created using R File "Figures_Appendix" lines 1103-1180




















